(global.webpackJsonp = global.webpackJsonp || []).push([ [ "wjyk_recycle/pages/transaction/my/order/detail/detail" ], {
    "0d93": function(e, t, n) {
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            n("8163"), t(n("66fd")), e(t(n("905b")).default);
        }).call(this, n("543d").createPage);
    },
    1872: function(e, t, n) {
        function r() {
            this.$createElement, this._self._c;
        }
        var a = {
            sunuiPopup: function() {
                return n.e("components/sunui-popup/sunui-popup").then(n.bind(null, "c2fe"));
            }
        }, u = [];
        n.d(t, "b", function() {
            return r;
        }), n.d(t, "c", function() {
            return u;
        }), n.d(t, "a", function() {
            return a;
        });
    },
    "2bef": function(e, t, n) {
        n.r(t);
        var r, a = n("81a8"), u = n.n(a);
        for (r in a) "default" !== r && function(e) {
            n.d(t, e, function() {
                return a[e];
            });
        }(r);
        t.default = u.a;
    },
    3888: function(e, t, n) {},
    4219: function(e, t, n) {
        var r = n("3888");
        n.n(r).a;
    },
    "81a8": function(e, n, i) {
        (function(a) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var u = e(i("4795")), r = e(i("5438"));
            function e(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            function s(e, t, n, r, a, u, o) {
                try {
                    var i = e[u](o), s = i.value;
                } catch (e) {
                    return n(e), 0;
                }
                i.done ? t(s) : Promise.resolve(s).then(r, a);
            }
            function o(i) {
                return function() {
                    var e = this, o = arguments;
                    return new Promise(function(t, n) {
                        var r = i.apply(e, o);
                        function a(e) {
                            s(r, t, n, a, u, "next", e);
                        }
                        function u(e) {
                            s(r, t, n, a, u, "throw", e);
                        }
                        a(void 0);
                    });
                };
            }
            var t = {
                data: function() {
                    return {
                        oid: "",
                        obj: {},
                        recycle: a.getStorageSync("name"),
                        money: 0,
                        isPay: !1,
                        userObj: {},
                        charge: ""
                    };
                },
                onLoad: function(e) {
                    this.oid = e.oid;
                },
                onShow: function() {
                    r.default.releaseKey("updateOrder"), this.detail(), this.user(), this.getCharge();
                },
                methods: {
                    close: function() {
                        this.$refs.pop.close();
                    },
                    openPop: function() {
                        var e;
                        Number(this.userObj.balance) < Number(this.obj.price) ? (this.isPay = !0, e = Number(Number(this.obj.price) - Number(this.userObj.balance)).toFixed(2), 
                        this.money = Number(Number(e) / Number(this.charge)).toFixed(2), console.log(this.money)) : this.isPay = !1, 
                        this.$refs.pop.show({
                            style: "background-color:#fff;width:504rpx;height:auth;border-radius:10rpx;"
                        });
                    },
                    getCharge: function() {
                        var n = this;
                        return o(u.default.mark(function e() {
                            var t;
                            return u.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.transactions
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && (n.charge = t.data.set.charge);

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    user: function() {
                        var n = this;
                        return o(u.default.mark(function e() {
                            var t;
                            return u.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.user,
                                        data: {
                                            uid: a.getStorageSync("uid")
                                        }
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && (n.userObj = t.data);

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    recycleOrder: function() {
                        this.close(), this.isPay ? this.wxPay() : this.createOrder();
                    },
                    wxPay: function() {
                        var n = this;
                        return o(u.default.mark(function e() {
                            var t;
                            return u.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.pay,
                                        show: !0,
                                        method: "post",
                                        data: {
                                            openid: a.getStorageSync("openid"),
                                            money: n.money
                                        }
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && a.requestPayment({
                                        provider: "wxpay",
                                        timeStamp: t.data.timeStamp,
                                        nonceStr: t.data.nonceStr,
                                        package: t.data.package,
                                        signType: t.data.signType,
                                        paySign: t.data.paySign,
                                        success: function() {
                                            var t = o(u.default.mark(function e(t) {
                                                return u.default.wrap(function(e) {
                                                    for (;;) switch (e.prev = e.next) {
                                                      case 0:
                                                        n.createOrder();

                                                      case 1:
                                                      case "end":
                                                        return e.stop();
                                                    }
                                                }, e);
                                            }));
                                            return function(e) {
                                                return t.apply(this, arguments);
                                            };
                                        }(),
                                        fail: function(e) {
                                            console.log(JSON.stringify(e)), n.$sun.toast("取消支付");
                                        }
                                    });

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    createOrder: function() {
                        var e, n = this;
                        r.default.uniDoFunc({
                            key: "updateOrder",
                            success: (e = o(u.default.mark(function e() {
                                var t;
                                return u.default.wrap(function(e) {
                                    for (;;) switch (e.prev = e.next) {
                                      case 0:
                                        return e.next = 2, n.$http({
                                            url: n.$api.updateStatus,
                                            data: {
                                                id: n.obj.id,
                                                is_status: 1,
                                                integral: n.obj.bargain_price,
                                                price: n.money
                                            }
                                        });

                                      case 2:
                                        0 == (t = e.sent).errno ? (n.detail(), a.showToast({
                                            title: t.message,
                                            duration: 1500
                                        })) : (n.$sun.toast(t.message), r.default.releaseKey("updateOrder")), console.log("防抖... 在事件触发前连续点击事件会重新计时");

                                      case 5:
                                      case "end":
                                        return e.stop();
                                    }
                                }, e);
                            })), function() {
                                return e.apply(this, arguments);
                            })
                        });
                    },
                    updateOrder: function() {
                        var t, r = this;
                        a.showModal({
                            title: "提示",
                            content: "确认该订单已收货?",
                            success: (t = o(u.default.mark(function e(t) {
                                var n;
                                return u.default.wrap(function(e) {
                                    for (;;) switch (e.prev = e.next) {
                                      case 0:
                                        if (t.confirm) return e.next = 3, r.$http({
                                            url: r.$api.updateStatus,
                                            data: {
                                                id: r.obj.id,
                                                is_status: 3
                                            }
                                        });
                                        e.next = 7;
                                        break;

                                      case 3:
                                        0 == (n = e.sent).errno && r.detail(), r.$sun.toast(n.message), e.next = 8;
                                        break;

                                      case 7:
                                        t.cancel && console.log("用户点击取消");

                                      case 8:
                                      case "end":
                                        return e.stop();
                                    }
                                }, e);
                            })), function(e) {
                                return t.apply(this, arguments);
                            })
                        });
                    },
                    detail: function() {
                        var n = this;
                        return o(u.default.mark(function e() {
                            var t;
                            return u.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.tOrderDetail,
                                        data: {
                                            uid: a.getStorageSync("uid"),
                                            id: n.oid
                                        }
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && (n.obj = t.data);

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    }
                }
            };
            n.default = t;
        }).call(this, i("543d").default);
    },
    "905b": function(e, t, n) {
        n.r(t);
        var r, a = n("1872"), u = n("2bef");
        for (r in u) "default" !== r && function(e) {
            n.d(t, e, function() {
                return u[e];
            });
        }(r);
        n("4219");
        var o = n("f0c5"), a = Object(o.a)(u.default, a.b, a.c, !1, null, null, null, !1, a.a, void 0);
        t.default = a.exports;
    }
}, [ [ "0d93", "common/runtime", "common/vendor" ] ] ]);